﻿<cfscript>
/** 
* DataBase Frameworks - Sequence
* 
* @hint "DataBase Frameworks - Sequence - LogInfo" 
*/ 

component 
	displayname="public.service.db.senate.sequence.LogInfo" 
	output=false 
	accessors=true 
	{

	/**
	* @hint "初始化对象"
	*/
	public function init() output=false {
		return this;
	}
	
	/**
	* @hint "生成主键"
	*/
	public string function getLogId() output=false {
		
		/* 
			考序号规则 6位代码
		*/
		var nextID = numberFormat(1, "0________");
			
		var sql = "	SELECT log_id FROM t_loginfo ORDER BY log_id DESC ";
						  
		var queryObj = new Query( datasource=application.dnsMaster, maxRows=1 );
			
		var rs_check = queryObj.execute( sql=sql ).getResult();
	
		if (rs_check.recordCount) {
			/* 创建一个追加id */
			nextID = numberFormat((rs_check.log_id + 1), "0________");
		}

		return nextID;
	}


}

</cfscript>